package com.ccc.ka.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import com.ccc.ka.util.KAResponse;
import org.springframework.web.bind.annotation.*;
import com.ccc.ka.service.ITeamService;
import com.ccc.ka.entity.Team;
import com.ccc.ka.util.BaseController;

/**
 * 
 * @author ccc
 * @since 2023-02-28
 */
@RestController
@RequestMapping("/team")
public class TeamController extends BaseController {

@Autowired
private ITeamService teamService;

@PostMapping("/saveTeam")
public KAResponse saveTeam(Team team){
    return success(teamService.save(team));
}

@DeleteMapping("/delTeam")
public KAResponse delTeam(Team team){
    return success(teamService.removeById(team));
}

@PutMapping("/updTeam")
public KAResponse putTeam(Team team){
    return success(teamService.updateById(team));
}

@GetMapping("/getTeam")
public KAResponse getTeam(String id){
    return success(teamService.getById(id));
}

@GetMapping("/getTeamList")
public KAResponse getTeamList(Team team){
    return success(teamService.list());
}

@GetMapping("/getTeamPage")
public KAResponse getTeamPage(Team team){
    return success(teamService.list());
}

}
